using System.Drawing;
using _3Dto2D.Models;

namespace _3Dto2D.Interfaces;

public interface IRenderEngine : IDisposable
{
    bool IsInitialized { get; }

    void Initialize();
    void RenderFrame(FrameData? frameData);

    Bitmap? RenderFrameToBitmap(FrameData frameData);
    void SetBackgroundColor(Color color);
    void SetViewport(int width, int height);

    event EventHandler<RenderErrorEventArgs>? RenderError;
}

public class RenderErrorEventArgs : EventArgs
{
    public Exception Exception { get; }
    public string Message { get; }

    public RenderErrorEventArgs(Exception exception, string message)
    {
        Exception = exception;
        Message = message;
    }
}
